package com.dcsgo.socketPlay.common;

import java.io.Serializable;

/**
 * @author DCSGO
 * @version 1.0
 */
public class Ball implements Serializable {
    private static final long serialVersionUID = 1L;
    private int x;
    private int y;
    private final int speed;
    private boolean visible = true;

    private void setVisible(boolean visible) {
        this.visible = visible;
    }

    public boolean isVisible() {
        return visible;
    }

    public Ball(int x, int y, int speed) {
        this.x = x;
        this.y = y;
        this.speed = speed;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int getSpeed() {
        return speed;
    }

    public void moveUp() {
        this.y -= speed;
    }

    public void moveRight() {
        this.x += speed;
    }

    public void moveDown() {
        this.y += speed;
    }

    public void moveLeft() {
        this.x -= speed;
    }
}
